/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rule;

import java.util.ArrayList;

/**
 *
 * @author livia
 */
public class Rule {
    private ArrayList<RuleSegment> head;
    private ArrayList<RuleSegment> body;

    public Rule() {
        this.head = new ArrayList<RuleSegment>();
        this.body = new ArrayList<RuleSegment>();
    }

    public void addHead(RuleSegment headSeg){
        head.add(headSeg);
    }

    public void addBody(RuleSegment bodySeg){
        body.add(bodySeg);
    }

   public String toString(){
	  String ret="";
	  for (RuleSegment r : head) ret+=r;
	  ret+="<-";
	  for (RuleSegment r : body) ret+=r;
	  return ret;
   }

    
}
